package com.sayice.design.lab8_2;

import java.util.HashMap;
import java.util.Map;

/**
 * @author shubing
 */
public abstract class AbstractGame {
    protected Map<Integer, Observer> observers = new HashMap<>(16);
    
    public void addPlayer(Player player) {
        observers.put(player.id, player);
    }
    
    public void removePlayer(Player player) {
        observers.remove(player.id);
    }
    
    public abstract void notice(int id, String msg);
    
    public abstract void noticeAll(String msg);
}
